﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Devdream.Models
{
    /// <summary>
    /// 用户模型
    /// </summary>
   public class User
    {
        [Key]
        public int UserID{ get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        /// 
        [Required(ErrorMessage="必填")]
        [StringLength(20,MinimumLength=4,ErrorMessage="{1}到{0}个字符串")]
        [Display(Name="用户名")]
        public string UserName { get; set; }
        /// <summary>
        /// 用户组ID
        /// </summary>
        /// []
        /// 
       
        /// <summary>
        /// 显示名称
        /// </summary>
        /// 
        [Required(ErrorMessage="必填")]
        [Display(Name="显示名称")]
        [StringLength(20,MinimumLength=2,ErrorMessage="{1}到{0}个字符串")]
        public string DisplayName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        /// 
        [Required(ErrorMessage="必填")]
        [Display(Name="密码")]
        [DataType(DataType.Password)]
        public string Password { get; set; }
        [Required(ErrorMessage="必填")]
        [Display(Name="邮箱")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }
        /// <summary>
        /// 用户状态
        /// 0正常1锁定2未通过验证3未通过管理员
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 用户注册时间
        /// </summary>
        public DateTime RegistrationTime { get; set; }
        /// <summary>
        /// 上次登录时间
        /// </summary>
        public DateTime LoginTime { get; set; }
        /// <summary>
        /// 上次登录IP
        /// </summary>
        public string LoginIP { get; set; }
       
        }
}
